import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { SequelizeModule } from '@nestjs/sequelize';
import { DatabaseModule } from 'src/database/database.module';
import { SysCodeController } from './controller/syscode.controller';
import { SysCodeEntity } from './entity/syscode.entity';
import { SysCodeProviders } from './provider/syscode.providers';
import { SysCodeSerivce } from './service/syscode.service';
import { jwtConstants } from '../auth/constants';

@Module({
  controllers: [SysCodeController],
  imports: [
    DatabaseModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: jwtConstants.expiresSecond }, // token 过期时效
    }),
    SequelizeModule.forFeature([SysCodeEntity]),
  ],
  providers: [SysCodeSerivce, ...SysCodeProviders],
})
export class SysCodeModule {}
